//
//  UIView+Frame.m
//  BuDeJie
//
//  Created by 仲琦 on 16/4/3.
//  Copyright © 2016年 仲琦. All rights reserved.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)

- (CGFloat)zq_centerX
{
    return self.center.x;
}
- (void)setZq_centerX:(CGFloat)zq_centerX
{
    CGPoint center = self.center;
    center.x = zq_centerX;
    self.center = center;
}

- (CGFloat)zq_centerY
{
    return self.center.y;
}
- (void)setZq_centerY:(CGFloat)zq_centerY
{
    CGPoint center = self.center;
    center.y = zq_centerY;
    self.center = center;
}


- (CGFloat)zq_x
{
    return self.frame.origin.x;
}
- (void)setZq_x:(CGFloat)zq_x
{
    CGRect rect = self.frame;
    rect.origin.x = zq_x;
    self.frame = rect;
}


- (CGFloat)zq_y
{
    return self.frame.origin.y;
}
- (void)setZq_y:(CGFloat)zq_y
{
    CGRect rect = self.frame;
    rect.origin.y = zq_y;
    self.frame = rect;
}


- (CGFloat)zq_height
{
    return self.frame.size.height;
}
- (void)setZq_height:(CGFloat)zq_height
{
    CGRect rect = self.frame;
    rect.size.height = zq_height;
    self.frame = rect;
}


- (CGFloat)zq_width
{
    return self.frame.size.width;
}
- (void)setZq_width:(CGFloat)zq_width
{
    CGRect rect = self.frame;
    rect.size.width = zq_width;
    self.frame = rect;
}

+ (instancetype)zq_viewFromXib
{
    return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].firstObject;
}
@end
